<template>
  <div class="legend">
    <div class="legend-item" v-for="(item, index) in legend" :key="index">
      <div class="mask" :style="{ backgroundColor: item.color }" />
      <div class="description">
        {{ item.description }}
      </div>
    </div>
  </div>
</template>
<script>
export default {
  props: {
    legend: {
      type: Array,
      default: () => []
    }
  }
}
</script>
<style scoped>
.legend {
  display: flex;
  justify-content: flex-start;
}
.legend-item {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  margin-right: 15px;
}
.mask {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  margin-right: 10px;
}
</style>
